home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Miscellaneous / CrunchShell Demo / myModeless.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-28  |  1.1 KB  |  49 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  myModeless.c
  3.  
  4.                          Handle a Demo Modeless Dialog Box
  5.                          
  6.                  Copyright 1988 Gregory H. Dow.  All Rights Reserved.
  7.  
  8.  ******************************************************************************/
  9.  
  10. #ifndef _DialogMgr_
  11. #include <DialogMgr.h>
  12. #endif
  13.  
  14. #ifndef _EventMgr_
  15. #include <EventMgr.h>
  16. #endif
  17.  
  18. #include "Common.h"
  19. #include "CModelessDlog.h"
  20.  
  21.  
  22. void    DoDemoFilter(theDialog, theEvent)
  23. DialogPtr        theDialog;
  24. EventRecord        *theEvent;
  25. {
  26.     if (theEvent->what == keyDown) {
  27.         if ((theEvent->message & charCodeMask) == '\r')
  28.             theEvent->what = nullEvent;
  29.     }
  30. }
  31.  
  32.  
  33. /******************************************************************************
  34.  DoDemoModeless
  35.  
  36.          Handle a modeless dialog box
  37.  ******************************************************************************/
  38.  
  39. void    DoDemoModeless(theMDobj, itemHit, theEvent)
  40. ModelessDlogObjH    theMDobj;
  41. short                itemHit;
  42. EventRecord            *theEvent;
  43. {
  44.     DialogPtr            theDialog;
  45.     
  46.     theDialog = (**theMDobj).theWPtr;
  47.     if (itemHit == 1)
  48.         SelIText(theDialog, 3, 0, MAXINT);
  49. }